
package org.atf.model.entity;

import java.io.Serializable;
import java.lang.Integer;
import java.lang.String;

import javax.persistence.*;

import org.apache.openjpa.persistence.Externalizer;
import org.apache.openjpa.persistence.Factory;


/**
 * Entity implementation class for Entity: User
 *
 *
 */
@Entity
@Table( name= "AFTUSER")
@NamedQueries({
	 @NamedQuery(name="User.findUserByName",
           	query="select u from User u where u.username = :username"),
     @NamedQuery(name="User.findUserByNamePassword",
           	query="select u from User u where u.username = :username and u.password = :password")
})

public class User implements Serializable {

	   
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "ID")
	private Integer userId;
	private String username;
	@Externalizer("EncryptDecryptHelper.getEncrypted")
	@Factory("EncryptDecryptHelper.getDecrypted")
	private String password;
	private String admin;
	private String groups;
	private static final long serialVersionUID = 1L;

	public User() {
		super();
	}   
	public User(String username2, String admin, String groups) {
		// TODO Auto-generated constructor stub
		this.username=username2;
		this.admin=admin;
		this.groups=groups;
	}
	public Integer getUserId() {
		return this.userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}   
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}   
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}   
	public String getAdmin() {
		return this.admin;
	}

	public void setAdmin(String admin) {
		this.admin = admin;
	}   
	public String getGroups() {
		return this.groups;
	}

	public void setGroups(String groups) {
		this.groups = groups;
	}
	@Override
	public String toString() {
		return "User [userId=" + userId + ", username=" + username
				+ ", password=" + password + ", admin=" + admin + ", groups="
				+ groups + "]";
	}
   
}
